package com.linux.huhx.thread1;

public class YieldThread extends Thread {
    YieldThread(String string) {
        super(string);
    }

    @Override
    public void run() {
        for (int i = 0; i < 10; i ++) {
            System.out.println(getName() + ", " + i);
            if (i % 2 == 0) {
                Thread.yield();
            }
        }
    }
}
